import Vue from 'vue'
import Router from 'vue-router'


import webHeader from '@/views/common/webHeader.vue'
import webFooter from '@/views/common/webFooter.vue'
import backHeader from '@/views/common/backHeader.vue'//后台菜单

//首页
const home = r => require.ensure([], () => r(require('@/views/index/home.vue')), 'home')
//灯具选择分类
const selectLampType = r => require.ensure([], () => r(require('@/views/selectLamp/selectLampType.vue')), 'selectLampType')
//灯具选择列表
const selectLampList = r => require.ensure([], () => r(require('@/views/selectLamp/selectLampList.vue')), 'selectLampList')
const selectLampListAll = r => require.ensure([], () => r(require('@/views/selectLamp/selectLampListAll.vue')), 'selectLampListAll')
//login
const login = r => require.ensure([], () => r(require('@/views/login/login.vue')), 'login')
//register
const register = r => require.ensure([], () => r(require('@/views/register/register.vue')), 'register')
//对比
const details = r => require.ensure([], () => r(require('@/views/selectLamp/details.vue')), 'details')
//项目管理
const project = r => require.ensure([], () => r(require('@/views/project/project.vue')), 'project')
//新增项目
const parameterLampList = r => require.ensure([], () => r(require('@/views/project/parameterLampList.vue')), 'parameterLampList')

const conformBrand = r => require.ensure([], () => r(require('@/views/project/conformBrand.vue')), 'conformBrand')

//后台管理
const administer = r => require.ensure([], () => r(require('@/views/administer/index.vue')), 'administer')
//人员管理-角色管理
const role = r => require.ensure([], () => r(require('@/views/administer/personnel/role.vue')), 'role')
//机构信息
const institutionalInformation = r => require.ensure([], () => r(require('@/views/administer/personnel/institutionalInformation.vue')), 'institutionalInformation')
//
const CoincidenceData = r => require.ensure([], () => r(require('@/views/administer/lamp/CoincidenceData.vue')), 'CoincidenceData')
//
const dosageAnalysis = r => require.ensure([], () => r(require('@/views/administer/analyze/dosageAnalysis.vue')), 'dosageAnalysis')
//人员管理-用户管理
const user = r => require.ensure([], () => r(require('@/views/administer/personnel/user.vue')), 'user')
//产品管理-品牌管理
const brand = r => require.ensure([], () => r(require('@/views/administer/product/brand.vue')), 'brand')
//产品管理-系列管理
const series = r => require.ensure([], () => r(require('@/views/administer/product/series.vue')), 'series')
//产品管理-产品管理
const product = r => require.ensure([], () => r(require('@/views/administer/product/product.vue')), 'product')
//产品管理-产品发布
const release = r => require.ensure([], () => r(require('@/views/administer/product/release.vue')), 'release')
//产品信息录入/编辑
const productInformation = r => require.ensure([], () => r(require('@/views/administer/product/productInformation.vue')), 'productInformation')
//maintenance产品信息维护
const maintenance = r => require.ensure([], () => r(require('@/views/administer/product/maintenance.vue')), 'maintenance')


//灯参信息
const information = r => require.ensure([], () => r(require('@/views/administer/lamp/information.vue')), 'information')
//实测数据
const lampData = r => require.ensure([], () => r(require('@/views/administer/lamp/lampData.vue')), 'lampData')
//应用分析
const application = r => require.ensure([], () => r(require('@/views/administer/analyze/application.vue')), 'application')
//产品分析
const productAnalyze = r => require.ensure([], () => r(require('@/views/administer/analyze/productAnalyze.vue')), 'productAnalyze')
//项目类型
const projectType = r => require.ensure([], () => r(require('@/views/administer/system/projectType.vue')), 'projectType')
//单体属性
const single  = r => require.ensure([], () => r(require('@/views/administer/system/single.vue')), 'single')

//自定义灯参
const custom  = r => require.ensure([], () => r(require('@/views/project/custom.vue')), 'custom')

//个人中心
const userCenter  = r => require.ensure([], () => r(require('@/views/userCenter/userCenter.vue')), 'userCenter')

//供应商入驻单页
const supplierInPage  = r => require.ensure([], () => r(require('@/views/supplierInPage/supplierInPage.vue')), 'supplierInPage')

//灯参审核
const auditHtml  = r => require.ensure([], () => r(require('@/views/project/auditHtml.vue')), 'auditHtml')

//虚拟试灯
const virtual  = r => require.ensure([], () => r(require('@/views/virtual/virtual.vue')), 'virtual')

//虚拟试灯
const test  = r => require.ensure([], () => r(require('@/views/index/test.vue')), 'test')

//实测数据
const datapush = r => require.ensure([], () => r(require('@/views/administer/lamp/datapush.vue')), 'datapush')

//产品筛灯
const productScreen = r => require.ensure([], () => r(require('@/views/screenLamp/productScreen.vue')), 'productScreen')
const productScreendetails = r => require.ensure([], () => r(require('@/views/screenLamp/productScreendetails.vue')), 'productScreendetails')
//灯具列表详情
const lampListDetails = r => require.ensure([], () => r(require('@/views/screenLamp/lampListDetails.vue')), 'lampListDetails')
//品牌页
const brandPage = r => require.ensure([], () => r(require('@/views/screenLamp/brandPage.vue')), 'brandPage')
//系列页
const seriesPage = r => require.ensure([], () => r(require('@/views/screenLamp/seriesPage.vue')), 'seriesPage')
//定标
const scaling = r => require.ensure([], () => r(require('@/views/project/scaling.vue')), 'scaling')

//noHtml5
const noHtml5 = r => require.ensure([], () => r(require('@/views/common/noHtml5.vue')), 'noHtml5')

Vue.use(Router)

export default new Router({
	// mode: 'history',
	routes: [{
		path: '/',
		components: {
			header: webHeader,
			footer: webFooter,
			default: home
		},
		meta:{
			title:'照明专家-首页'
		}
	},{
		path: '/test',
		components: {
			default: test
		},
		meta:{
			title:'test'
		}
	},{
		path: '/noHtml5',
		components: {
			default: noHtml5
		},
		meta:{
			title:'noHtml5'
		}
	},
	{
		path: '/selectLampType',
		components: {
			header: webHeader,
			footer: webFooter,
			default: selectLampType
		},
		meta:{
			title:'照明专家-应用面选灯',
			requiresAuth:true
		}
	},{
		path: '/selectLampList',
		components: {
			header: webHeader,
			footer: webFooter,
			default: selectLampList
		},
		meta:{
			title:'照明专家-应用面选灯',
			requiresAuth:true
		}
	},{
		path: '/selectLampListAll',
		components: {
			header: webHeader,
			footer: webFooter,
			default: selectLampListAll
		},
		meta:{
			title:'照明专家-应用面选灯',
			requiresAuth:true
		}
	},
	
	{
		path: '/virtual',
		components: {
			header: webHeader,
			footer: webFooter,
			default: virtual
		},
		meta:{
			title:'虚拟试灯',
			// requiresAuth:true
		}
	},{
		path: '/login',
		components: {
			header: webHeader,
			footer: webFooter,
			default: login
		},
		meta:{
			title:'照明专家-登录'
		}
	},{
		path: '/selectLamp/details',
		components: {
			header: webHeader,
			footer: webFooter,
			default: details
		},
		meta:{
			title:'照明专家-应用面选灯',
			requiresAuth:true
		}
	},{
		path: '/register',
		components: {
			header: webHeader,
			footer: webFooter,
			default: register
		}
	},{
		path: '/project',
		components: {
			header: webHeader,
			footer: webFooter,
			default: project
		},
		meta:{
			title:'照明专家-项目管理',
			requiresAuth:true
		}
	},{
		path: '/parameterLampList',
		components: {
			header: webHeader,
			footer: webFooter,
			default: parameterLampList
		},
		meta:{
			title:'照明专家-项目管理',
			requiresAuth:true
		}
	},{
		path: '/scaling',
		components: {
			header: webHeader,
			footer: webFooter,
			default: scaling
		},
		meta:{
			title:'照明专家-项目管理',
			requiresAuth:true
		}
	},{
		path: '/conformBrand',
		components: {
			header: webHeader,
			footer: webFooter,
			default: conformBrand
		},
		meta:{
			title:'照明专家-项目管理',
			requiresAuth:true
		}
	},
	{
		path: '/administer',
		components: {
			header1: backHeader,
			default: administer
		},
		meta:{
			title:'照明专家-后台管理',
			requiresAuth:true
		}
	},{
		path: '/institutionalInformation',
		components: {
			default: institutionalInformation
		},
		meta:{
			title:'照明专家-后台管理',
			requiresAuth:true
		}
	},{
		path: '/CoincidenceData',
		components: {
			default: CoincidenceData
		},
		meta:{
			title:'照明专家-后台管理',
			requiresAuth:true
		}
	},{
		path: '/dosageAnalysis',
		components: {
			default: dosageAnalysis
		},
		meta:{
			title:'照明专家-后台管理',
			requiresAuth:true
		}
	},
	{
		path: '/role',
		components: {
			default: role
		},
		meta:{
			title:'角色管理',
			requiresAuth:true
		}
	},{
		path: '/user',
		components: {
			default: user
		},
		meta:{
			title:'用户管理',
			requiresAuth:true
		}
	},{
		path: '/brand',
		components: {
			default: brand
		},
		meta:{
			title:'品牌管理',
			requiresAuth:true
		}
	},{
		path: '/series',
		components: {
			default: series
		},
		meta:{
			title:'系列管理',
			requiresAuth:true
		}
	},{
		path: '/product',
		components: {
			default: product
		},
		meta:{
			title:'产品管理',
			requiresAuth:true
		}
	},{
		path: '/release',
		components: {
			default: release
		},
		meta:{
			title:'产品发布',
			requiresAuth:true
		}
	},{
		path: '/productInformation',
		components: {
			default: productInformation
		},
		meta:{
			title:'产品信息录入/编辑',
			requiresAuth:true
		}
	},{
		path: '/maintenance',
		components: {
			default: maintenance
		},
		meta:{
			title:'产品信息维护',
			requiresAuth:true
		}
	},{
		path: '/information',
		components: {
			default: information
		},
		meta:{
			title:'灯参推送',
			requiresAuth:true
		}
	},{
		path: '/lampData',
		components: {
			default: lampData
		},
		meta:{
			title:'实测数据',
			requiresAuth:true
		}
	},
	{
		path: '/datapush',
		components: {
			default: datapush
		},
		meta:{
			title:'数据发布',
			requiresAuth:true
		}
	},
	{
		path: '/productAnalyze',
		components: {
			default: productAnalyze
		},
		meta:{
			title:'产品分析',
			requiresAuth:true
		}
	},{
		path: '/application',
		components: {
			default: application
		},
		meta:{
			title:'应用分析',
			requiresAuth:true
		}
	},{
		path: '/single',
		components: {
			default: single
		},
		meta:{
			title:'单体属性',
			requiresAuth:true
		}
	},{
		path: '/projectType',
		components: {
			default: projectType
		},
		meta:{
			title:'项目类型',
			requiresAuth:true
		}
	},{
		path: '/custom',
		components: {
			header: webHeader,
			footer: webFooter,
			default: custom
		},
		meta:{
			title:'照明专家-项目管理',
			requiresAuth:true
		}
	},{
		path: '/supplierInPage',
		components: {
			header: webHeader,
			footer: webFooter,
			default: supplierInPage
		},meta:{
			title:'照明专家-供应商入驻',
		}
	},{
		path: '/auditHtml',
		components: {
			header: webHeader,
			default: auditHtml
		},
		meta:{
			title:'照明专家-项目管理',
			requiresAuth:true
		}
	},{
		path: '/userCenter',
		components: {
			header: webHeader,
			footer: webFooter,
			default: userCenter
		},
		meta:{
			title:'照明专家-个人中心',
			requiresAuth:true
		}
	},{
		path: '/productScreen',
		components: {
			header: webHeader,
			footer: webFooter,
			default: productScreen
		},
		meta:{
			title:'照明专家-产品筛灯'
		}
	},{
		path: '/lampListDetails',
		components: {
			header: webHeader,
			footer: webFooter,
			default: lampListDetails
		},
		meta:{
			title:'照明专家-灯具列表详情'
		}
	},{
		path: '/brandPage',
		components: {
			header: webHeader,
			footer: webFooter,
			default: brandPage
		},
		meta:{
			title:'照明专家-品牌页'
		}
	},{
		path: '/seriesPage',
		components: {
			header: webHeader,
			footer: webFooter,
			default: seriesPage
		},
		meta:{
			title:'照明专家-系列页'
		}
	},{
		path: '/productScreen/details',
		components: {
			header: webHeader,
			footer: webFooter,
			default: productScreendetails
		},
		meta:{
			title:'照明专家-产品筛灯'
		}
	}
]
})
